package com.srcptit.trainning.tranquangvinh.b1;

import java.util.Scanner;

public class Bai1 {
	public static void SapXep(int a[],int n) {
		for(int i=0;i<n-1;i++){
			for(int j=i+1;j<n;j++){
				if(a[i]>a[j]){
					int tmp=a[i];
					a[i]=a[j];
					a[j]=tmp;
				}
			}
		}
	}
	public static  void main(String[] args) {
		System.out.println("Nhap so nguyen n:");
		Scanner sc= new Scanner(System.in) ;
		int n;
		n=sc.nextInt();
		int a[]= new int [n];
		System.out.println("Nhap cac phan tu cua mang");
		for(int i=0;i<n;i++){
			a[i]=sc.nextInt();
		}
		SapXep(a,n);
		for(int i=0;i<n;i++){
			System.out.print(a[i]+" ");
		}	
			
	}
}
